<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for cssgen.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file cssgen.php</h1>
<p>Documentation is available at <a href="../core/_contrib_cssgen_php.html">cssgen.php</a></p>
<div class="src-code">
<pre><a name="a1"></a><br />1     <span class="src-php">&lt;?php</span><a name="a2"></a><br />2     <span class="src-doc">/***********************************************************************************</span><a name="a3"></a><br />3     <span class="src-doc"> * cssgen.php</span><a name="a4"></a><br />4     <span class="src-doc"> * ----------</span><a name="a5"></a><br />5     <span class="src-doc"> * Author: Nigel McNie (oracle.shinoda@gmail.com)</span><a name="a6"></a><br />6     <span class="src-doc"> * Copyright: (c) 2004 Nigel McNie</span><a name="a7"></a><br />7     <span class="src-doc"> * Release Version: 1.0.7.3</span><a name="a8"></a><br />8     <span class="src-doc"> * CVS Revision Version: $Revision: 1.5 $</span><a name="a9"></a><br />9     <span class="src-doc"> * Date Started: 2004/05/20</span><a name="a10"></a><br />10    <span class="src-doc"> * Last Modified: $Date: 2005/09/22 01:47:19 $</span><a name="a11"></a><br />11    <span class="src-doc"> *</span><a name="a12"></a><br />12    <span class="src-doc"> * Application to generate custom CSS files for GeSHi (based on an idea by Andreas</span><a name="a13"></a><br />13    <span class="src-doc"> * Gohr)</span><a name="a14"></a><br />14    <span class="src-doc"> *</span><a name="a15"></a><br />15    <span class="src-doc"> ************************************************************************************</span><a name="a16"></a><br />16    <span class="src-doc"> *</span><a name="a17"></a><br />17    <span class="src-doc"> *     This file is part of GeSHi.</span><a name="a18"></a><br />18    <span class="src-doc"> *</span><a name="a19"></a><br />19    <span class="src-doc"> *   GeSHi is free software; you can redistribute it and/or modify</span><a name="a20"></a><br />20    <span class="src-doc"> *   it under the terms of the GNU General Public License as published by</span><a name="a21"></a><br />21    <span class="src-doc"> *   the Free Software Foundation; either version 2 of the License, or</span><a name="a22"></a><br />22    <span class="src-doc"> *   (at your option) any later version.</span><a name="a23"></a><br />23    <span class="src-doc"> *</span><a name="a24"></a><br />24    <span class="src-doc"> *   GeSHi is distributed in the hope that it will be useful,</span><a name="a25"></a><br />25    <span class="src-doc"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of</span><a name="a26"></a><br />26    <span class="src-doc"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><a name="a27"></a><br />27    <span class="src-doc"> *   GNU General Public License for more details.</span><a name="a28"></a><br />28    <span class="src-doc"> *</span><a name="a29"></a><br />29    <span class="src-doc"> *   You should have received a copy of the GNU General Public License</span><a name="a30"></a><br />30    <span class="src-doc"> *   along with GeSHi; if not, write to the Free Software</span><a name="a31"></a><br />31    <span class="src-doc"> *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span><a name="a32"></a><br />32    <span class="src-doc"> *</span><a name="a33"></a><br />33    <span class="src-doc"> ************************************************************************************/</span><a name="a33"></a><br />33    <a name="a34"></a><br />34    <a name="a35"></a><br />35    <a href="http://www.php.net/set_magic_quotes_runtime">set_magic_quotes_runtime</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">)</span>;<a name="a36"></a><br />36    <span class="src-comm">//</span><a name="a37"></a><br />37    <span class="src-comm">// Functions</span><a name="a38"></a><br />38    <span class="src-comm">//</span><a name="a39"></a><br />39    <a name="a40"></a><br />40    <span class="src-key">function</span> <a href="../core/_contrib_cssgen_php.html#functionmake_header">make_header</a> <span class="src-sym">(</span> <span class="src-var">$title</span> <span class="src-sym">)</span><a name="a41"></a><br />41    <span class="src-sym">{</span><a name="a42"></a><br />42        echo <span class="src-str">'&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span><a name="a43"></a><br />43    <span class="src-str">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</span><a name="a44"></a><br />44    <span class="src-str">&lt;head&gt;</span><a name="a45"></a><br />45    <span class="src-str">	&lt;title&gt;GeSHi CSS Generator :: '</span> . <span class="src-var">$title</span> . <span class="src-str">' &lt;/title&gt;</span><a name="a46"></a><br />46    <span class="src-str">	&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;</span><a name="a47"></a><br />47    <span class="src-str">	&lt;!--</span><a name="a48"></a><br />48    <span class="src-str">		html {</span><a name="a49"></a><br />49    <span class="src-str">			font-family: Verdana, Arial, sans-serif;</span><a name="a50"></a><br />50    <span class="src-str">			font-size: 80%;</span><a name="a51"></a><br />51    <span class="src-str">			background-color: #d0d0d0;</span><a name="a52"></a><br />52    <span class="src-str">		}</span><a name="a53"></a><br />53    <span class="src-str">		body {</span><a name="a54"></a><br />54    <span class="src-str">			margin: 10px;</span><a name="a55"></a><br />55    <span class="src-str">			padding: 5px;</span><a name="a56"></a><br />56    <span class="src-str">			border: 1px solid #f0f0f0;</span><a name="a57"></a><br />57    <span class="src-str">			background-color: #f6f6f6;</span><a name="a58"></a><br />58    <span class="src-str">		}</span><a name="a59"></a><br />59    <span class="src-str">		h1 {</span><a name="a60"></a><br />60    <span class="src-str">			border-bottom: 2px solid #e0e0e0;</span><a name="a61"></a><br />61    <span class="src-str">			font-weight: normal;</span><a name="a62"></a><br />62    <span class="src-str">			font-size: 150%;</span><a name="a63"></a><br />63    <span class="src-str">			color: #c0c0c0;</span><a name="a64"></a><br />64    <span class="src-str">		}</span><a name="a65"></a><br />65    <span class="src-str">		input, textarea {</span><a name="a66"></a><br />66    <span class="src-str">			border: 1px solid #d0d0d0;</span><a name="a67"></a><br />67    <span class="src-str">		}</span><a name="a68"></a><br />68    <span class="src-str">		th {</span><a name="a69"></a><br />69    <span class="src-str">			text-align: right;</span><a name="a70"></a><br />70    <span class="src-str">			font-weight: normal;</span><a name="a71"></a><br />71    <span class="src-str">		}</span><a name="a72"></a><br />72    <span class="src-str">		pre {</span><a name="a73"></a><br />73    <span class="src-str">			font-size: 110%;</span><a name="a74"></a><br />74    <span class="src-str">			color: #202020;</span><a name="a75"></a><br />75    <span class="src-str">		}</span><a name="a76"></a><br />76    <span class="src-str">		#footer {</span><a name="a77"></a><br />77    <span class="src-str">			color: #b0b0b0;</span><a name="a78"></a><br />78    <span class="src-str">			text-align: center;</span><a name="a79"></a><br />79    <span class="src-str">			font-size: 90%;</span><a name="a80"></a><br />80    <span class="src-str">			margin: 0 auto;</span><a name="a81"></a><br />81    <span class="src-str">			border-top: 1px solid #e0e0e0;</span><a name="a82"></a><br />82    <span class="src-str">		}</span><a name="a83"></a><br />83    <span class="src-str">		#footer a {</span><a name="a84"></a><br />84    <span class="src-str">			color: #c0c0c0;</span><a name="a85"></a><br />85    <span class="src-str">		}</span><a name="a86"></a><br />86    <span class="src-str">	--&gt;</span><a name="a87"></a><br />87    <span class="src-str">	&lt;/style&gt;</span><a name="a88"></a><br />88    <span class="src-str">    &lt;script type=&quot;text/javascript&quot;&gt;</span><a name="a89"></a><br />89    <span class="src-str">    function select (state)</span><a name="a90"></a><br />90    <span class="src-str">    {</span><a name="a91"></a><br />91    <span class="src-str">        var cboxes = document.getElementsByTagName(\'input\');</span><a name="a92"></a><br />92    <span class="src-str">        for (var i = 0; i &lt; cboxes.length; i++) {</span><a name="a93"></a><br />93    <span class="src-str">            if (cboxes[i].type == &quot;checkbox&quot;) {</span><a name="a94"></a><br />94    <span class="src-str">                if (state == &quot;true&quot;) {</span><a name="a95"></a><br />95    <span class="src-str">                    cboxes[i].checked = true;</span><a name="a96"></a><br />96    <span class="src-str">                } else if (state == &quot;false&quot;) {</span><a name="a97"></a><br />97    <span class="src-str">                    cboxes[i].checked = false;</span><a name="a98"></a><br />98    <span class="src-str">                } else if (state == &quot;invert&quot;) {</span><a name="a99"></a><br />99    <span class="src-str">                    cboxes[i].checked = !cboxes[i].checked;</span><a name="a100"></a><br />100   <span class="src-str">                }</span><a name="a101"></a><br />101   <span class="src-str">            }</span><a name="a102"></a><br />102   <span class="src-str">        }</span><a name="a103"></a><br />103   <span class="src-str">    }</span><a name="a104"></a><br />104   <span class="src-str">    &lt;/script&gt;</span><a name="a105"></a><br />105   <span class="src-str">&lt;/head&gt;</span><a name="a106"></a><br />106   <span class="src-str">&lt;body&gt;</span><a name="a107"></a><br />107   <span class="src-str">&lt;h1&gt;'</span> . <span class="src-var">$title</span> . <span class="src-str">'&lt;/h1&gt;</span><a name="a108"></a><br />108   <span class="src-str">'</span>;<a name="a109"></a><br />109   <span class="src-sym">}</span><a name="a110"></a><br />110   <a name="a111"></a><br />111   <span class="src-key">function</span> <a href="../core/_contrib_cssgen_php.html#functionmake_footer">make_footer</a> <span class="src-sym">(</span><span class="src-sym">)</span><a name="a112"></a><br />112   <span class="src-sym">{</span><a name="a113"></a><br />113       echo <span class="src-str">'&lt;div id=&quot;footer&quot;&gt;&lt;a href=&quot;http://qbnz.com/highlighter/&quot;&gt;GeSHi&lt;/a&gt; &amp;copy; Nigel McNie, 2004, released under the GPL&lt;/div&gt;&lt;/body&gt;</span><a name="a114"></a><br />114   <span class="src-str">&lt;/html&gt;'</span>;<a name="a115"></a><br />115   <span class="src-sym">}</span><a name="a116"></a><br />116   <a name="a117"></a><br />117   <a name="a118"></a><br />118   <span class="src-key">function</span> <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a> <span class="src-sym">(</span> <span class="src-var">$var_name</span> <span class="src-sym">)</span><a name="a119"></a><br />119   <span class="src-sym">{</span><a name="a120"></a><br />120       <span class="src-key">if</span> <span class="src-sym">(</span> isset<span class="src-sym">(</span><span class="src-var">$_GET</span><span class="src-sym">[</span><span class="src-var">$var_name</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a121"></a><br />121       <span class="src-sym">{</span><a name="a122"></a><br />122           <span class="src-key">return</span> <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\'&quot;</span><span class="src-sym">,</span> <span class="src-str">&quot;'&quot;</span><span class="src-sym">,</span> <span class="src-var">$_GET</span><span class="src-sym">[</span><span class="src-var">$var_name</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a123"></a><br />123       <span class="src-sym">}</span><a name="a124"></a><br />124       <span class="src-key">elseif</span> <span class="src-sym">(</span> isset<span class="src-sym">(</span><span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-var">$var_name</span><span class="src-sym">]</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a125"></a><br />125       <span class="src-sym">{</span><a name="a126"></a><br />126           <span class="src-key">return</span> <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\'&quot;</span><span class="src-sym">,</span> <span class="src-str">&quot;'&quot;</span><span class="src-sym">,</span> <span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-var">$var_name</span><span class="src-sym">]</span><span class="src-sym">)</span>;<a name="a127"></a><br />127       <span class="src-sym">}</span><a name="a128"></a><br />128       <span class="src-key">return</span> <span class="src-id">null</span>;<a name="a129"></a><br />129   <span class="src-sym">}</span><a name="a130"></a><br />130   <a name="a131"></a><br />131   <a name="a132"></a><br />132   <a name="a133"></a><br />133   <span class="src-comm">//</span><a name="a134"></a><br />134   <span class="src-comm">// Unset everything</span><a name="a135"></a><br />135   <span class="src-comm">//</span><a name="a136"></a><br />136   <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-var">$_REQUEST</span> <span class="src-key">as</span> <span class="src-var">$var</span> <span class="src-sym">)</span><a name="a137"></a><br />137   <span class="src-sym">{</span><a name="a138"></a><br />138       unset<span class="src-sym">(</span>$<span class="src-var">$var</span><span class="src-sym">)</span>;<a name="a139"></a><br />139   <span class="src-sym">}</span><a name="a140"></a><br />140   <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-key">array</span><span class="src-sym">(</span><a name="a141"></a><br />141       <span class="src-str">'_POST'</span> =&gt; <span class="src-str">'HTTP_POST_VARS'</span><span class="src-sym">,</span><a name="a142"></a><br />142       <span class="src-str">'_GET'</span> =&gt; <span class="src-str">'HTTP_GET_VARS'</span><span class="src-sym">,</span><a name="a143"></a><br />143       <span class="src-str">'_COOKIE'</span> =&gt; <span class="src-str">'HTTP_COOKIE_VARS'</span><span class="src-sym">,</span><a name="a144"></a><br />144       <span class="src-str">'_SERVER'</span> =&gt; <span class="src-str">'HTTP_SERVER_VARS'</span><span class="src-sym">,</span><a name="a145"></a><br />145       <span class="src-str">'_ENV'</span> =&gt; <span class="src-str">'HTTP_ENV_VARS'</span><span class="src-sym">,</span><a name="a146"></a><br />146       <span class="src-str">'_FILES'</span> =&gt; <span class="src-str">'HTTP_POST_FILES'</span><span class="src-sym">)</span>  <span class="src-key">as</span> <span class="src-var">$array</span> =&gt; <span class="src-var">$other</span> <span class="src-sym">)</span><a name="a147"></a><br />147   <span class="src-sym">{</span><a name="a148"></a><br />148       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-sym">!</span>isset<span class="src-sym">(</span>$<span class="src-var">$array</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a149"></a><br />149       <span class="src-sym">{</span><a name="a150"></a><br />150           $<span class="src-var">$array</span> = $<span class="src-var">$other</span>;<a name="a151"></a><br />151       <span class="src-sym">}</span><a name="a152"></a><br />152       unset<span class="src-sym">(</span>$<span class="src-var">$other</span><span class="src-sym">)</span>;<a name="a153"></a><br />153   <span class="src-sym">}</span><a name="a154"></a><br />154   <a name="a155"></a><br />155   <a name="a156"></a><br />156   <span class="src-comm">// Get what step we're up to</span><a name="a157"></a><br />157   <span class="src-var">$step</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'step'</span><span class="src-sym">)</span>;<a name="a158"></a><br />158   <a name="a159"></a><br />159   <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-sym">!</span><span class="src-var">$step</span> || <span class="src-var">$step</span> == <span class="src-num">1</span> <span class="src-sym">)</span><a name="a160"></a><br />160   <span class="src-sym">{</span><a name="a161"></a><br />161       <span class="src-var">$errors</span> = <span class="src-num">0</span>;<a name="a162"></a><br />162       <a href="../core/_contrib_cssgen_php.html#functionmake_header">make_header</a><span class="src-sym">(</span><span class="src-str">'Step 1'</span><span class="src-sym">)</span>;<a name="a163"></a><br />163       echo <span class="src-str">&quot;Welcome to the GeSHi CSS generator.&lt;br /&gt;&lt;pre&gt;Searching for GeSHi...          &quot;</span>;<a name="a164"></a><br />164   <a name="a165"></a><br />165       <span class="src-comm">// Find GeSHi</span><a name="a166"></a><br />166       <span class="src-var">$geshi_path</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'geshi-path'</span><span class="src-sym">)</span>;<a name="a167"></a><br />167       <span class="src-var">$geshi_lang_path</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'geshi-lang-path'</span><span class="src-sym">)</span>;<a name="a168"></a><br />168   <a name="a169"></a><br />169       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-sym">!</span><span class="src-var">$geshi_path</span> <span class="src-sym">)</span><a name="a170"></a><br />170       <span class="src-sym">{</span><a name="a171"></a><br />171           <span class="src-var">$geshi_path</span> = <span class="src-str">'../geshi.php'</span>;<a name="a172"></a><br />172       <span class="src-sym">}</span><a name="a173"></a><br />173       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-sym">!</span><span class="src-var">$geshi_lang_path</span> <span class="src-sym">)</span><a name="a174"></a><br />174       <span class="src-sym">{</span><a name="a175"></a><br />175           <span class="src-var">$geshi_lang_path</span> = <span class="src-str">'../geshi/'</span>;<a name="a176"></a><br />176       <span class="src-sym">}</span><a name="a177"></a><br />177   <a name="a178"></a><br />178   <a name="a179"></a><br />179       <span class="src-key">if</span> <span class="src-sym">(</span> <a href="http://www.php.net/is_file">is_file</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> &amp;&amp; <a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a180"></a><br />180       <span class="src-sym">{</span><a name="a181"></a><br />181           <span class="src-comm">// Get file contents and see if GeSHi is in here</span><a name="a182"></a><br />182           <span class="src-var">$file</span> = <span class="src-sym">@</span><a href="http://www.php.net/file">file</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span>;<a name="a183"></a><br />183           <span class="src-var">$contents</span> = <span class="src-str">''</span>;<a name="a184"></a><br />184           <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-var">$file</span> <span class="src-key">as</span> <span class="src-var">$line</span> <span class="src-sym">)</span><a name="a185"></a><br />185           <span class="src-sym">{</span><a name="a186"></a><br />186               <span class="src-var">$contents</span> .= <span class="src-var">$line</span>;<a name="a187"></a><br />187           <span class="src-sym">}</span><a name="a188"></a><br />188           <span class="src-key">if</span> <span class="src-sym">(</span> <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$contents</span><span class="src-sym">,</span> <span class="src-str">'&lt;?php</span><a name="a189"></a><br />189   <span class="src-str">/**</span><a name="a190"></a><br />190   <span class="src-str"> * GeSHi - Generic Syntax Highlighter</span><a name="a191"></a><br />191   <span class="src-str"> * </span><a name="a192"></a><br />192   <span class="src-str"> * The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation</span><a name="a193"></a><br />193   <span class="src-str"> * at http://qbnz.com/highlighter/documentation.php for more information about how to</span><a name="a194"></a><br />194   <span class="src-str"> * use this class.'</span><span class="src-sym">)</span> !== <span class="src-id">false</span> <span class="src-sym">)</span><a name="a195"></a><br />195            <span class="src-sym">{</span><a name="a196"></a><br />196               echo <span class="src-str">'&lt;span style=&quot;color: green;&quot;&gt;Found at '</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> . <span class="src-str">'&lt;/span&gt;'</span>;<a name="a197"></a><br />197           <span class="src-sym">}</span><a name="a198"></a><br />198           <span class="src-key">else</span><a name="a199"></a><br />199           <span class="src-sym">{</span><a name="a200"></a><br />200               ++<span class="src-var">$errors</span>;<a name="a201"></a><br />201               <span class="src-var">$no_geshi_dot_php_error</span> = <span class="src-id">true</span>;<a name="a202"></a><br />202               echo <span class="src-str">'&lt;span style=&quot;color: red;&quot;&gt;Not found&lt;/span&gt;'</span>;<a name="a203"></a><br />203           <span class="src-sym">}</span><a name="a204"></a><br />204       <span class="src-sym">}</span><a name="a205"></a><br />205       <span class="src-key">else</span><a name="a206"></a><br />206       <span class="src-sym">{</span><a name="a207"></a><br />207           ++<span class="src-var">$errors</span>;<a name="a208"></a><br />208           <span class="src-var">$no_geshi_dot_php_error</span> = <span class="src-id">true</span>;<a name="a209"></a><br />209           echo <span class="src-str">'&lt;span style=&quot;color: red;&quot;&gt;Not found&lt;/span&gt;'</span>;<a name="a210"></a><br />210       <span class="src-sym">}</span><a name="a211"></a><br />211   <a name="a212"></a><br />212       <span class="src-comm">// Find language files</span><a name="a213"></a><br />213       echo <span class="src-str">&quot;\nSearching for language files... &quot;</span>;<a name="a214"></a><br />214       <span class="src-key">if</span> <span class="src-sym">(</span> <a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$geshi_lang_path</span> . <span class="src-str">'css-gen.cfg'</span><span class="src-sym">)</span> <span class="src-sym">)</span><a name="a215"></a><br />215       <span class="src-sym">{</span><a name="a216"></a><br />216   <a name="a217"></a><br />217           echo <span class="src-str">'&lt;span style=&quot;color: green;&quot;&gt;Found at '</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_lang_path</span><span class="src-sym">)</span> . <span class="src-str">'&lt;/span&gt;'</span>;<a name="a218"></a><br />218       <span class="src-sym">}</span><a name="a219"></a><br />219       <span class="src-key">else</span><a name="a220"></a><br />220       <span class="src-sym">{</span><a name="a221"></a><br />221           ++<span class="src-var">$errors</span>;<a name="a222"></a><br />222           <span class="src-var">$no_lang_dir_error</span> = <span class="src-id">true</span>;<a name="a223"></a><br />223           echo <span class="src-str">'&lt;span style=&quot;color: red;&quot;&gt;Not found&lt;/span&gt;'</span>;<a name="a224"></a><br />224       <span class="src-sym">}</span><a name="a225"></a><br />225       echo <span class="src-str">&quot;&lt;/pre&gt;\n&quot;</span>;<a name="a226"></a><br />226   <a name="a227"></a><br />227       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$errors</span> &gt; <span class="src-num">0</span> <span class="src-sym">)</span><a name="a228"></a><br />228       <span class="src-sym">{</span><a name="a229"></a><br />229           <span class="src-comm">// We're gonna have to ask for the paths...</span><a name="a230"></a><br />230           echo <span class="src-str">'Unfortunately CSSGen could not detect the following paths. Please input them and press &amp;quot;submit&amp;quot; to try again.'</span>;<a name="a231"></a><br />231           echo <span class="src-str">&quot;</span><a name="a232"></a><br />232   <span class="src-str">&lt;form action=\&quot;cssgen.php\&quot; method=\&quot;post\&quot;&gt;&quot;</span>;<a name="a233"></a><br />233           <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$no_geshi_dot_php_error</span> <span class="src-sym">)</span><a name="a234"></a><br />234           <span class="src-sym">{</span><a name="a235"></a><br />235               echo <span class="src-str">&quot;</span><a name="a236"></a><br />236   <span class="src-str">&lt;br /&gt;geshi.php: &lt;input type=\&quot;text\&quot; name=\&quot;geshi-path\&quot; value=\&quot;&quot;</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-str">'../geshi.php'</span><span class="src-sym">)</span> . <span class="src-str">&quot;\&quot; size=\&quot;50\&quot; /&gt;&quot;</span>;<a name="a237"></a><br />237           <span class="src-sym">}</span><a name="a238"></a><br />238           <span class="src-key">else</span><a name="a239"></a><br />239           <span class="src-sym">{</span><a name="a240"></a><br />240               echo <span class="src-str">'&lt;input type=&quot;hidden&quot; name=&quot;geshi-path&quot; value=&quot;'</span> . <a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> . <span class="src-str">'&quot; /&gt;'</span>;<a name="a241"></a><br />241           <span class="src-sym">}</span><a name="a242"></a><br />242           <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$no_lang_dir_error</span> <span class="src-sym">)</span><a name="a243"></a><br />243           <span class="src-sym">{</span><a name="a244"></a><br />244               echo <span class="src-str">&quot;</span><a name="a245"></a><br />245   <span class="src-str">&lt;br /&gt;language files directory: &lt;input type=\&quot;text\&quot; name=\&quot;geshi-lang-path\&quot; value=\&quot;&quot;</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-str">'../geshi/'</span><span class="src-sym">)</span> . <span class="src-str">&quot;/\&quot; size=\&quot;50\&quot; /&gt; (should have a trailing slash)&quot;</span>;<a name="a246"></a><br />246           <span class="src-sym">}</span><a name="a247"></a><br />247           <span class="src-key">else</span><a name="a248"></a><br />248           <span class="src-sym">{</span><a name="a249"></a><br />249               echo <span class="src-str">'&lt;input type=&quot;hidden&quot; name=&quot;geshi-lang-path&quot; value=&quot;'</span> . <span class="src-var">$geshi_lang_path</span> . <span class="src-str">'&quot; /&gt;'</span>;<a name="a250"></a><br />250           <span class="src-sym">}</span><a name="a251"></a><br />251   <a name="a252"></a><br />252           echo <span class="src-str">&quot;</span><a name="a253"></a><br />253   <span class="src-str">&lt;br /&gt;&lt;input type=\&quot;submit\&quot; value=\&quot;Search\&quot; /&gt;&lt;/form&gt;&quot;</span>;<a name="a254"></a><br />254       <span class="src-sym">}</span><a name="a255"></a><br />255       <span class="src-key">else</span><a name="a256"></a><br />256       <span class="src-sym">{</span><a name="a257"></a><br />257           <span class="src-comm">// no errors - echo continue form</span><a name="a258"></a><br />258           echo <span class="src-str">'Everything seems to be detected successfully. Use the button to continue.</span><a name="a259"></a><br />259   <span class="src-str">&lt;br /&gt;&lt;br /&gt;&lt;form action=&quot;cssgen.php?step=2&quot; method=&quot;post&quot;&gt;</span><a name="a260"></a><br />260   <span class="src-str">&lt;input type=&quot;hidden&quot; name=&quot;geshi-path&quot; value=&quot;'</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> . <span class="src-str">'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;geshi-lang-path&quot; value=&quot;'</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_lang_path</span><span class="src-sym">)</span> . <span class="src-str">'&quot; /&gt;</span><a name="a261"></a><br />261   <span class="src-str">&lt;input type=&quot;submit&quot; value=&quot;Step 2&quot; /&gt;'</span>;<a name="a262"></a><br />262       <span class="src-sym">}</span><a name="a263"></a><br />263   <a name="a264"></a><br />264       <a href="../core/_contrib_cssgen_php.html#functionmake_footer">make_footer</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a265"></a><br />265   <span class="src-sym">}</span><a name="a266"></a><br />266   <span class="src-comm">// Step 2</span><a name="a267"></a><br />267   <span class="src-key">elseif</span> <span class="src-sym">(</span> <span class="src-var">$step</span> == <span class="src-num">2</span> <span class="src-sym">)</span><a name="a268"></a><br />268   <span class="src-sym">{</span><a name="a269"></a><br />269       <a href="../core/_contrib_cssgen_php.html#functionmake_header">make_header</a><span class="src-sym">(</span><span class="src-str">'Step 2'</span><span class="src-sym">)</span>;<a name="a270"></a><br />270   <a name="a271"></a><br />271       <span class="src-var">$geshi_path</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'geshi-path'</span><span class="src-sym">)</span>;<a name="a272"></a><br />272       <span class="src-var">$geshi_lang_path</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'geshi-lang-path'</span><span class="src-sym">)</span>;<a name="a273"></a><br />273   <a name="a274"></a><br />274       <span class="src-var">$dh</span> = <a href="http://www.php.net/opendir">opendir</a><span class="src-sym">(</span><span class="src-var">$geshi_lang_path</span><span class="src-sym">)</span>;<a name="a275"></a><br />275       <span class="src-var">$lang_files</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a276"></a><br />276       <span class="src-var">$file</span> = <a href="http://www.php.net/readdir">readdir</a><span class="src-sym">(</span><span class="src-var">$dh</span><span class="src-sym">)</span>;<a name="a277"></a><br />277       <span class="src-key">while</span> <span class="src-sym">(</span> <span class="src-var">$file</span> !== <span class="src-id">false</span> <span class="src-sym">)</span><a name="a278"></a><br />278       <span class="src-sym">{</span><a name="a279"></a><br />279           <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$file</span> == <span class="src-str">'.'</span> || <span class="src-var">$file</span> == <span class="src-str">'..'</span> || <span class="src-var">$file</span> == <span class="src-str">'CVS'</span> || <span class="src-var">$file</span> == <span class="src-str">'css-gen.cfg'</span> <span class="src-sym">)</span><a name="a280"></a><br />280           <span class="src-sym">{</span><a name="a281"></a><br />281               <span class="src-var">$file</span> = <a href="http://www.php.net/readdir">readdir</a><span class="src-sym">(</span><span class="src-var">$dh</span><span class="src-sym">)</span>;<a name="a282"></a><br />282               <span class="src-key">continue</span>;<a name="a283"></a><br />283           <span class="src-sym">}</span><a name="a284"></a><br />284           <span class="src-var">$lang_files</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-var">$file</span>;<a name="a285"></a><br />285           <span class="src-var">$file</span> = <a href="http://www.php.net/readdir">readdir</a><span class="src-sym">(</span><span class="src-var">$dh</span><span class="src-sym">)</span>;<a name="a286"></a><br />286       <span class="src-sym">}</span><a name="a287"></a><br />287       <a href="http://www.php.net/closedir">closedir</a><span class="src-sym">(</span><span class="src-var">$dh</span><span class="src-sym">)</span>;<a name="a288"></a><br />288       <a href="http://www.php.net/sort">sort</a><span class="src-sym">(</span><span class="src-var">$lang_files</span><span class="src-sym">)</span>;<a name="a289"></a><br />289   <a name="a290"></a><br />290       <span class="src-comm">// Now installed languages are in $lang_files</span><a name="a291"></a><br />291   <a name="a292"></a><br />292       echo <span class="src-str">'&lt;form action=&quot;cssgen.php?step=3&quot; method=&quot;post&quot; id=&quot;step2&quot;&gt;</span><a name="a293"></a><br />293   <span class="src-str">What languages are you wanting to make this stylesheet for?&lt;br /&gt;&lt;br /&gt;</span><a name="a294"></a><br />294   <span class="src-str">Detected languages:&lt;br /&gt;'</span>;<a name="a295"></a><br />295   <a name="a296"></a><br />296       <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-var">$lang_files</span> <span class="src-key">as</span> <span class="src-var">$lang</span> <span class="src-sym">)</span><a name="a297"></a><br />297       <span class="src-sym">{</span><a name="a298"></a><br />298           <span class="src-var">$lang</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$lang</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$lang</span><span class="src-sym">,</span> <span class="src-str">'.'</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a299"></a><br />299           echo &quot;&lt;<span class="src-id">input</span> <span class="src-id">type</span>=\&quot;<span class="src-id">checkbox</span>\&quot; <span class="src-id">name</span>=\&quot;<span class="src-id">langs</span><span class="src-sym">[</span><span class="src-var">$lang</span><span class="src-sym">]</span>\&quot; <span class="src-id">checked</span>=\&quot;<span class="src-id">checked</span>\&quot; /&gt;&amp;<span class="src-id">nbsp</span>;<span class="src-var">$lang</span>&lt;<span class="src-id">br</span> /&gt;\n&quot;;<a name="a300"></a><br />300       <span class="src-sym">}</span><a name="a301"></a><br />301   <a name="a302"></a><br />302       echo <span class="src-str">&quot;Select: &lt;a href=\&quot;javascript:select('true')\&quot;&gt;All&lt;/a&gt;, &lt;a href=\&quot;javascript:select('false')\&quot;&gt;None&lt;/a&gt;, &lt;a href=\&quot;javascript:select('invert')\&quot;&gt;Invert&lt;/a&gt;&lt;br /&gt;\n&quot;</span>; <a name="a303"></a><br />303   <a name="a304"></a><br />304       echo <span class="src-str">'If you\'d like any other languages not detected here to be supported, please enter</span><a name="a305"></a><br />305   <span class="src-str">them here, one per line:&lt;br /&gt;&lt;textarea rows=&quot;4&quot; cols=&quot;20&quot; name=&quot;extra-langs&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;</span><a name="a306"></a><br />306   <span class="src-str">'</span>;<a name="a307"></a><br />307   <a name="a308"></a><br />308       echo <span class="src-str">'&lt;br /&gt;Styles:</span><a name="a309"></a><br />309   <span class="src-str">&lt;table&gt;</span><a name="a310"></a><br />310   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Style for the overall code block:&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;overall&quot; value=&quot;border: 1px dotted #a0a0a0; font-family: \'Courier New\', Courier, monospace; background-color: #f0f0f0; color: #0000bb;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a311"></a><br />311   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Default Styles&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;default-styles&quot; value=&quot;font-weight:normal;background:transparent;color:#000; padding-left: 5px;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a312"></a><br />312   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Keywords I (if, do, while etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;keywords-1&quot; value=&quot;color: #a1a100;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a313"></a><br />313   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Keywords II (null, true, false etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;keywords-2&quot; value=&quot;color: #000; font-weight: bold;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a314"></a><br />314   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Inbuilt Functions (echo, print etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;keywords-3&quot; value=&quot;color: #000066;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a315"></a><br />315   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Data Types (int, boolean etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;keywords-4&quot; value=&quot;color: #f63333;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a316"></a><br />316   <a name="a317"></a><br />317   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Comments (//, &lt;!--  --&gt; etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;comments&quot; value=&quot;color: #808080;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a318"></a><br />318   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Escaped Characters (\n, \t etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;escaped-chars&quot; value=&quot;color: #000033; font-weight: bold;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a319"></a><br />319   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Brackets ( ([{}]) etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;brackets&quot; value=&quot;color: #66cc66;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a320"></a><br />320   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Strings (&quot;foo&quot; etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;strings&quot; value=&quot;color: #ff0000;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a321"></a><br />321   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Numbers (1, -54, 2.5 etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;numbers&quot; value=&quot;color: #ff33ff;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a322"></a><br />322   <span class="src-str">	&lt;tr&gt;&lt;th&gt;Methods (Foo.bar() etc)&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;methods&quot; value=&quot;color: #006600;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;</span><a name="a323"></a><br />323   <span class="src-str">&lt;/table&gt;'</span>;<a name="a324"></a><br />324   <a name="a325"></a><br />325       echo <span class="src-str">'&lt;input type=&quot;hidden&quot; name=&quot;geshi-path&quot; value=&quot;'</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_path</span><span class="src-sym">)</span> . <span class="src-str">'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;geshi-lang-path&quot; value=&quot;'</span> . <a href="http://www.php.net/realpath">realpath</a><span class="src-sym">(</span><span class="src-var">$geshi_lang_path</span><span class="src-sym">)</span> . <span class="src-str">'&quot; /&gt;</span><a name="a326"></a><br />326   <span class="src-str">&lt;input type=&quot;submit&quot; value=&quot;Step 3&quot; /&gt;&lt;/form&gt;'</span>;<a name="a327"></a><br />327   <a name="a328"></a><br />328       <a href="../core/_contrib_cssgen_php.html#functionmake_footer">make_footer</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a329"></a><br />329   <span class="src-sym">}</span><a name="a330"></a><br />330   <span class="src-comm">// Step 3</span><a name="a331"></a><br />331   <span class="src-key">elseif</span> <span class="src-sym">(</span> <span class="src-var">$step</span> == <span class="src-num">3</span> <span class="src-sym">)</span><a name="a332"></a><br />332   <span class="src-sym">{</span><a name="a333"></a><br />333       <a href="../core/_contrib_cssgen_php.html#functionmake_header">make_header</a><span class="src-sym">(</span><span class="src-str">'Step 3'</span><span class="src-sym">)</span>;<a name="a334"></a><br />334       echo <span class="src-str">'&lt;p&gt;Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing,</span><a name="a335"></a><br />335   <span class="src-str">you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however</span><a name="a336"></a><br />336   <span class="src-str">it includes most of the basic information.&lt;/p&gt;'</span>;<a name="a337"></a><br />337   <a name="a338"></a><br />338       <span class="src-comm">// Make the stylesheet</span><a name="a339"></a><br />339       <span class="src-var">$part_selector_1</span> = <span class="src-str">''</span>;<a name="a340"></a><br />340       <span class="src-var">$part_selector_2</span> = <span class="src-str">''</span>;<a name="a341"></a><br />341       <span class="src-var">$part_selector_3</span> = <span class="src-str">''</span>;<a name="a342"></a><br />342   <a name="a343"></a><br />343       <span class="src-var">$langs</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'langs'</span><span class="src-sym">)</span>;<a name="a344"></a><br />344       <span class="src-var">$extra_langs</span> = <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'extra-langs'</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a345"></a><br />345       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$extra_langs</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a346"></a><br />346       <span class="src-sym">{</span><a name="a347"></a><br />347           <span class="src-var">$l</span> = <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,</span> <span class="src-var">$extra_langs</span><span class="src-sym">)</span>;<a name="a348"></a><br />348           <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-var">$l</span> <span class="src-key">as</span> <span class="src-var">$lng</span> <span class="src-sym">)</span><a name="a349"></a><br />349           <span class="src-sym">{</span><a name="a350"></a><br />350               <span class="src-var">$langs</span><span class="src-sym">[</span><span class="src-var">$lng</span><span class="src-sym">]</span> = <span class="src-id">true</span>;<a name="a351"></a><br />351           <span class="src-sym">}</span><a name="a352"></a><br />352       <span class="src-sym">}</span><a name="a353"></a><br />353   <a name="a354"></a><br />354   <a name="a355"></a><br />355       <span class="src-key">foreach</span> <span class="src-sym">(</span> <span class="src-var">$langs</span> <span class="src-key">as</span> <span class="src-var">$lang</span> =&gt; <span class="src-var">$dummy</span> <span class="src-sym">)</span><a name="a356"></a><br />356       <span class="src-sym">{</span><a name="a357"></a><br />357           <span class="src-var">$part_selector_1</span> .= &quot;.<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART</span><span class="src-sym">}</span>, &quot;;<a name="a358"></a><br />358           <span class="src-var">$part_selector_2</span> .= &quot;.<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART1</span><span class="src-sym">}</span>, .<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART2</span><span class="src-sym">}</span>, &quot;;<a name="a359"></a><br />359           <span class="src-var">$part_selector_3</span> .= &quot;.<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART1</span><span class="src-sym">}</span>, .<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART2</span><span class="src-sym">}</span>, .<span class="src-var">$lang</span> <span class="src-sym">{</span><span class="src-id">PART3</span><span class="src-sym">}</span>, &quot;;<a name="a360"></a><br />360       <span class="src-sym">}</span><a name="a361"></a><br />361       <span class="src-var">$part_selector_1</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part_selector_1</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> -<span class="src-num">2</span><span class="src-sym">)</span>;<a name="a362"></a><br />362       <span class="src-var">$part_selector_2</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part_selector_2</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> -<span class="src-num">2</span><span class="src-sym">)</span>;<a name="a363"></a><br />363       <span class="src-var">$part_selector_3</span> = <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part_selector_3</span><span class="src-sym">,</span> <span class="src-num">0</span><span class="src-sym">,</span> -<span class="src-num">2</span><span class="src-sym">)</span>;<a name="a364"></a><br />364   <a name="a365"></a><br />365   <a name="a366"></a><br />366       <span class="src-var">$default_styles</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'default-styles'</span><span class="src-sym">)</span>;<a name="a367"></a><br />367       <span class="src-var">$ol_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'ol'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a368"></a><br />368       <span class="src-var">$overall_styles</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'overall'</span><span class="src-sym">)</span>;<a name="a369"></a><br />369       <span class="src-var">$overall_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a370"></a><br />370   <a name="a371"></a><br />371       <span class="src-var">$stylesheet</span> = <span class="src-str">&quot;/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */&quot;</span>;<a name="a372"></a><br />372   <a name="a373"></a><br />373       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$overall</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a374"></a><br />374       <span class="src-sym">{</span><a name="a375"></a><br />375           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$overall_selector</span> <span class="src-sym">{</span>{<span class="src-var">$overall_styles</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a376"></a><br />376       <span class="src-sym">}</span><a name="a377"></a><br />377       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$default_styles</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a378"></a><br />378       <span class="src-sym">{</span><a name="a379"></a><br />379           <span class="src-var">$default_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'{PART1}'</span><span class="src-sym">,</span> <span class="src-str">'{PART2}'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'.de1'</span><span class="src-sym">,</span> <span class="src-str">'.de2'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$part_selector_2</span><span class="src-sym">)</span>;<a name="a380"></a><br />380           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$default_selector</span> <span class="src-sym">{</span>{<span class="src-var">$default_styles</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a381"></a><br />381       <span class="src-sym">}</span><a name="a382"></a><br />382   <a name="a383"></a><br />383       <span class="src-comm">// Do keywords</span><a name="a384"></a><br />384       <span class="src-var">$keywords_1</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'keywords-1'</span><span class="src-sym">)</span>;<a name="a385"></a><br />385       <span class="src-var">$keyword_selector_1</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.kw1'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a386"></a><br />386       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$keywords_1</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a387"></a><br />387       <span class="src-sym">{</span><a name="a388"></a><br />388           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$keyword_selector_1</span> <span class="src-sym">{</span>{<span class="src-var">$keywords_1</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a389"></a><br />389       <span class="src-sym">}</span><a name="a390"></a><br />390   <a name="a391"></a><br />391       <span class="src-var">$keywords_2</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'keywords-2'</span><span class="src-sym">)</span>;<a name="a392"></a><br />392       <span class="src-var">$keyword_selector_2</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.kw2'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a393"></a><br />393       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$keywords_2</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a394"></a><br />394       <span class="src-sym">{</span><a name="a395"></a><br />395           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$keyword_selector_2</span> <span class="src-sym">{</span>{<span class="src-var">$keywords_2</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a396"></a><br />396       <span class="src-sym">}</span><a name="a397"></a><br />397   <a name="a398"></a><br />398       <span class="src-var">$keywords_3</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'keywords-3'</span><span class="src-sym">)</span>;<a name="a399"></a><br />399       <span class="src-var">$keyword_selector_3</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.kw3'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a400"></a><br />400       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$keywords_3</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a401"></a><br />401       <span class="src-sym">{</span><a name="a402"></a><br />402           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$keyword_selector_3</span> <span class="src-sym">{</span>{<span class="src-var">$keywords_3</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a403"></a><br />403       <span class="src-sym">}</span><a name="a404"></a><br />404   <a name="a405"></a><br />405       <span class="src-var">$keywords_4</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'keywords-4'</span><span class="src-sym">)</span>;<a name="a406"></a><br />406       <span class="src-var">$keyword_selector_4</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.kw4'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a407"></a><br />407       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$keywords_4</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a408"></a><br />408       <span class="src-sym">{</span><a name="a409"></a><br />409           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$keyword_selector_4</span> <span class="src-sym">{</span>{<span class="src-var">$keywords_4</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a410"></a><br />410       <span class="src-sym">}</span><a name="a411"></a><br />411   <a name="a412"></a><br />412       <span class="src-comm">// Do other lexics</span><a name="a413"></a><br />413       <span class="src-var">$comments</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'comments'</span><span class="src-sym">)</span>;<a name="a414"></a><br />414       <span class="src-var">$comment_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'{PART1}'</span><span class="src-sym">,</span> <span class="src-str">'{PART2}'</span><span class="src-sym">,</span> <span class="src-str">'{PART3}'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'.co1'</span><span class="src-sym">,</span> <span class="src-str">'.co2'</span><span class="src-sym">,</span> <span class="src-str">'.coMULTI'</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$part_selector_3</span><span class="src-sym">)</span>;<a name="a415"></a><br />415       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$comments</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a416"></a><br />416       <span class="src-sym">{</span><a name="a417"></a><br />417           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$comment_selector</span> <span class="src-sym">{</span>{<span class="src-var">$comments</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a418"></a><br />418       <span class="src-sym">}</span><a name="a419"></a><br />419   <a name="a420"></a><br />420       <span class="src-var">$esc</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'escaped-chars'</span><span class="src-sym">)</span>;<a name="a421"></a><br />421       <span class="src-var">$esc_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.es0'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a422"></a><br />422       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$esc</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a423"></a><br />423       <span class="src-sym">{</span><a name="a424"></a><br />424           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$esc_selector</span> <span class="src-sym">{</span>{<span class="src-var">$esc</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a425"></a><br />425       <span class="src-sym">}</span><a name="a426"></a><br />426   <a name="a427"></a><br />427       <span class="src-var">$brackets</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'brackets'</span><span class="src-sym">)</span>;<a name="a428"></a><br />428       <span class="src-var">$brk_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.br0'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a429"></a><br />429       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$brackets</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a430"></a><br />430       <span class="src-sym">{</span><a name="a431"></a><br />431           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$brk_selector</span> <span class="src-sym">{</span>{<span class="src-var">$brackets</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a432"></a><br />432       <span class="src-sym">}</span><a name="a433"></a><br />433   <a name="a434"></a><br />434       <span class="src-var">$strings</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'strings'</span><span class="src-sym">)</span>;<a name="a435"></a><br />435       <span class="src-var">$string_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.st0'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a436"></a><br />436       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$strings</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a437"></a><br />437       <span class="src-sym">{</span><a name="a438"></a><br />438           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$string_selector</span> <span class="src-sym">{</span>{<span class="src-var">$strings</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a439"></a><br />439       <span class="src-sym">}</span><a name="a440"></a><br />440   <a name="a441"></a><br />441       <span class="src-var">$numbers</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'numbers'</span><span class="src-sym">)</span>;<a name="a442"></a><br />442       <span class="src-var">$num_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.nu0'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a443"></a><br />443       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$numbers</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a444"></a><br />444       <span class="src-sym">{</span><a name="a445"></a><br />445           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$num_selector</span> <span class="src-sym">{</span>{<span class="src-var">$numbers</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a446"></a><br />446       <span class="src-sym">}</span><a name="a447"></a><br />447   <a name="a448"></a><br />448       <span class="src-var">$methods</span> = <a href="../core/_contrib_cssgen_php.html#functionget_var">get_var</a><span class="src-sym">(</span><span class="src-str">'methods'</span><span class="src-sym">)</span>;<a name="a449"></a><br />449       <span class="src-var">$method_selector</span> = <a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'{PART}'</span><span class="src-sym">,</span> <span class="src-str">'.me0'</span><span class="src-sym">,</span> <span class="src-var">$part_selector_1</span><span class="src-sym">)</span>;<a name="a450"></a><br />450       <span class="src-key">if</span> <span class="src-sym">(</span> <span class="src-var">$methods</span> != <span class="src-str">''</span> <span class="src-sym">)</span><a name="a451"></a><br />451       <span class="src-sym">{</span><a name="a452"></a><br />452           <span class="src-var">$stylesheet</span> .= &quot;\n<span class="src-var">$method_selector</span> <span class="src-sym">{</span>{<span class="src-var">$methods</span><span class="src-sym">}</span><span class="src-sym">}</span>&quot;;<a name="a453"></a><br />453       <span class="src-sym">}</span><a name="a454"></a><br />454   <a name="a455"></a><br />455       echo &quot;&lt;<span class="src-id">pre</span>&gt;<span class="src-var">$stylesheet</span>&lt;/<span class="src-id">pre</span>&gt;&quot;;<a name="a456"></a><br />456   <a name="a457"></a><br />457       <a href="../core/_contrib_cssgen_php.html#functionmake_footer">make_footer</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a458"></a><br />458   <span class="src-sym">}</span><a name="a459"></a><br />459   <a name="a460"></a><br />460   <span class="src-php">?&gt;</span></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 22 Sep 2005 13:47:51 +1200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
	</p>
	</body>
</html>